package yf.mall.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import yf.mall.dao.SysUsersDao;
import yf.mall.entity.SysUsersEntity;
import yf.mall.service.SysUsersService;
import com.yf.service.impl.BaseServiceImpl;

import java.util.List;

/**
 * 系统用户Service实现类
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Sun Jun 28 17:37:34 CST 2020
 */
@Service
public class SysUsersServiceImpl extends BaseServiceImpl<SysUsersEntity> implements SysUsersService {

    private SysUsersDao sysUserDao;


    @Autowired
    public void setDao(SysUsersDao sysUserDao) {
        this.sysUserDao = sysUserDao;
        super.setBaseDao(sysUserDao);
    }




    /**
     *
     *   @Override
     *     public List<UserVo> queryListVo(UserVo userVo) {
     *         return userDao.queryListVo(userVo);
     *     }
     *
     *     @Override
     *     public UserVo getVo(Long id) {
     *         return userDao.getVo(id);
     *     }

     @Override
     List<SysUserVo> queryListVo(SysUserVo sysUserVo){
            return sysUserDao.queryListVo(sysUserVo);
     }

     @Override
     SysUserVo getVo(Long id){
                return sysUserDao.getVo(id);
    }

     **/


    /**内部方法**/



    /**外部方法实现**/

    @Override
    public void updateBySysUserId(Long sys_user_id, Long user_id) {
        sysUserDao.updateBySysUserId(sys_user_id,user_id);
    }

    @Override
    public void saveUserIdAndSysUserId(Long sys_user_id, Long user_id) {
        sysUserDao.saveUserIdAndSysUserId(sys_user_id,user_id);
    }

    @Override
    public Long findBySysUserId(Long sys_user_id) {
        return sysUserDao.findBySysUserId(sys_user_id);
    }

    @Override
    public List<Long> findByUserId(Long user_id) {
        return sysUserDao.findByUserId(user_id);
    }

    @Override
    public void delBySysUserId(Long ids) {
        sysUserDao.delBySysUserId(ids);
    }

    @Override
    public void updateStatus(Long sys_userId) {
        sysUserDao.updateStatus(sys_userId);
    }

    @Override
    public void delByUserId(Long userId) {
        sysUserDao.delByUserId(userId);
    }

    @Override
    public List<Long> findRole(Long sysUserId) {
        return sysUserDao.findRole(sysUserId);
    }

    @Override
    public List<SysUsersEntity> findByShopName(String shopName, Integer status, String username, String mobile) {
        return sysUserDao.findByShopName(shopName,status,username,mobile);
    }

    @Override
    public SysUsersEntity findByUserName(String userName) {
        return sysUserDao.findByUserName(userName);
    }

    @Override
    public void saveRole(Long userId, Long roleId) {
        sysUserDao.saveRole(userId,roleId);
    }
}
